<?php

/**
 * Description of g
 * 
 * @author 叶风
 * Qq:    355007778
 * Email: ye.fn@163.com
 */

namespace c\attribute;

class g extends \control
{    
    function __construct($t1)
    {
        $t1 && $this->table = $t1;
        parent::__construct();
    } 
    
    function getLi($data_id)
    {
        $tables = array('at'=>array('as'=>'attribute_type'));
		$tables['t1'] = array('as'=>$this->table, 'join'=>'JOIN', 'on'=>'t1.type_id=at.id');
        return $this->db->group('t1.type_id')->get($tables, 'at.name, GROUP_CONCAT(t1.value) value',"t1.data_id=$data_id AND at.state>0", 'at.ordering, at.id');
    }
}
